package cn.buk.tms.dao;

import cn.buk.common.sc.CommonSearchCriteria;
import cn.buk.tms.sc.SearchQinfoCriteria;
import cn.buk.tms.sc.SearchTprCriteria;
import cn.buk.tms.entity.bill.BillFlightRefundTicket;
import cn.buk.tms.entity.bill.BillFlightTicket;
import cn.buk.tms.entity.misc.Qinfo;
import cn.buk.tms.entity.misc.QinfoNotice;
import cn.buk.tms.entity.misc.SubclassInfo;
import cn.buk.tms.entity.misc.TicketSale;

import java.util.Date;
import java.util.List;

/**
 * Created by yfdai on 16/6/13.
 */
public interface FlightCharterDao {

    List<Qinfo> searchQinfo(int enterpriseId, SearchQinfoCriteria sc);

    int reInformQinfo(int enterpriseId, int id);

    int createQinfoNotice(QinfoNotice qinfoNotice);

    int deleteQinfoNotice(int enterpriseId, int id);

    List<QinfoNotice> searchQinfoNotice(int enterpriseId, CommonSearchCriteria sc);

    /**
     * 保存仓位信息
     */
    int saveSubclassInfo(SubclassInfo info);

    List<SubclassInfo> searchSubclassInfos(int enterpriseId, CommonSearchCriteria sc);

    BillFlightTicket searchBillFlightTicket(int enterpriseId, String balCode, String tickNo);

    int createFlightRefundTicket(BillFlightRefundTicket refundTicket);

    List<BillFlightRefundTicket> searchFlightRefundTickets(int enterpriseId, CommonSearchCriteria sc);


    /**
     * 批量保存，忽略保存失败的
     */
    int createTicketSales(List<TicketSale> tickets);

    /**
     * 查询指定日期所有的出票记录
     *
     * @param enterpriseId 企业ID
     * @param sellDate     出票日期
     * @return 出票记录列表
     */
    List<TicketSale> searchTprs(int enterpriseId, Date sellDate);

    List<TicketSale> searchTprs(int enterpriseId, String ticketNo, int ticketStatus);

    /**
     * 根据查询条件，分页查找出票记录
     *
     * @param enterpriseId 企业ID
     * @param ticketNo     票号
     * @param sc           其它查询条件
     * @return 出票记录列表
     */
    List<TicketSale> searchTprs(int enterpriseId, String ticketNo, SearchTprCriteria sc);


    /**
     * 通过票号和客票状态查找已有的客票销售信息
     *
     * @param ticketStatus TSLorTPR中的客票状态
     *                     0 - 出票
     *                     1 - 改签
     *                     4 - 退票
     */
    TicketSale getTicketSaleByTicketNo(int enterpriseId, String ticketNo, int ticketStatus);

    SubclassInfo getSubclassInfoById(int id);

}
